package chapter07;

import java.util.HashMap;

public class Test05_count {
    public static void main(String[] args) {
        HashMap<Character, Integer> map = new HashMap<>();
        String s = "asjdfhlasbvbk";
        for(int i=0;i<s.length();i++){
            char c = s.charAt(i);
            //判断是否存在
            if(map.containsKey(c)){
                map.put(c,map.get(c)+1);
            }else{
                map.put(c,1);
            }
        }
        System.out.println(map);
    }
}
